package com.yupi.oj.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.yupi.oj.model.dto.ai.AiMessage;
import com.yupi.oj.model.dto.ai.AiRequest;
import com.yupi.oj.model.entity.AiAnswer;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author 兰飞宇
* @description 针对表【ai_answer(AI回答表)】的数据库操作Service
* @createDate 2025-03-20 16:40:06
*/
public interface AiAnswerService extends IService<AiAnswer> {
    /**
     * AI回答
     * @param aiRequest
     * @param request
     * @return
     */
    String doChat(AiRequest aiRequest, HttpServletRequest request);

    /**
     * 流式调用AI
     * @param aiRequest
     * @param request
     * @return
     */
    SseEmitter doChatStream(AiRequest aiRequest, HttpServletRequest request);
    /**
     * 根据题目Id与用户获取对话列表
     * @param questionId
     * @param request
     * @return
     */

    List<AiMessage> getAiMessageByQuestionId(Long questionId, HttpServletRequest request);
}
